As a technique for searching for a specific pattern existing on an object sample, a template matching method is known. More particularly, with semiconductor devices becoming finer and finer, a template matching method for carrying out position alignment of an image obtained by typically an SEM (Scanning Electron Microscope) for evaluating the semiconductor devices is required to provide better precision. Patent document 1 explains a process of creating a template on the basis of design data of a semiconductor device and a technique for carrying out pattern matching by making use of the template. In addition, patent document 2 discloses a technique for determining line portions (or protrusions) and space portions (or dents) in a pattern referred to as a line-and-space pattern in which lines are arranged at all but equal distances. Patent document 3 explains position alignment between design data including an additional evaluation region and a pattern image and a technique for evaluating the shape of a pattern, which is included in the additional evaluation region, after the position alignment.